package game;

public abstract class Player {
	protected final String nickname;
	
	// 默认第一次猜测的数是0
	protected int guessNumber = 0;
	
	// 默认第一次猜测结果是过小
	// 猜测结果 0：猜中，1：过大，-1：过小
	protected int result = -1;
	
	public Player(String nickname) {
		this.nickname = nickname;
	}
	
	public abstract int guess();
	
	public String getNickname() {
		return nickname;
	}
	
	public void setResult(int result) {
		this.result = result;
	}
	
	public boolean isSuccess() {
		return result == 0;
	}
}
